package org.xi.behavioral.interpreter.impl;

import org.xi.behavioral.interpreter.api.Expression;

/**
 * 非终结符表达式 - 减法
 */
public class SubtractExpression implements Expression {
    private final Expression left;
    private final Expression right;

    public SubtractExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret() {
        return left.interpret() - right.interpret();
    }
}
